<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var money = 100;
        do {
            var fun = parseInt(prompt("欢迎使用简易计算器：\n1.加法运算\n2.减法运算\n3.乘法运算\n4.除法运算\n5.退出"));
            if (num != 5) {
                var num1 = parseInt(parseInt(prompt("请输入第一个数据：")));
                var num2 = parseInt(parseInt(prompt("请输入第二个数据：")));
            }
            switch (fun) {
                case 1:
                    if (isNaN(num1) || isNaN(num2)) {
                        alert("您输入的数据不对")
                    } else {
                        alert("运算结果是：" + (num1 + num2))
                    }
                    break;
                case 2:
                    if (isNaN(num1) || isNaN(num2)) {
                        alert("您输入的数据不对")
                    } else {
                        alert("运算结果是：" + (num1 - num2))
                    }
                    break;
                case 3:
                    if (isNaN(num1) || isNaN(num2)) {
                        alert("您输入的数据不对")
                    } else {
                        alert("运算结果是：" + (num1 * num2))
                    }
                    break;
                case 4:
                    if (isNaN(num1) || isNaN(num2)) {
                        alert("您输入的数据不对")
                    } else {
                        alert("运算结果是：" + (num1 / num2))
                    }
                    break;
            }
        } while (fun != 5)
    </script>
</body>

</html>